from selenium.webdriver.support.wait import WebDriverWait

from tools import DriverTools


class TargetBase:
    def __init__(self):
        self.driver = DriverTools().OpenDriver()

    def target_element(self, element_info):
        return WebDriverWait(self.driver, 10).until(lambda x: x.find_element(*element_info))


# 清理文本内容
class CommandBase:
    def clear_text(self, element, text):
        element.clear()
        element.send_keys(text)
